package behavioralPattern.observer.example03;

import behavioralPattern.observer.example02.DrawHouseService;
import behavioralPattern.observer.example02.LotteryResult;

import java.util.Date;

public class LotteryServiceImpl extends LotteryService {

    // 注入摇号服务
    private DrawHouseService houseService = new DrawHouseService();

    @Override
    public LotteryResult lottery(String uid) {
        // 摇号
        String result = houseService.lots(uid);
        return new LotteryResult(uid,result,new Date());
    }
}
